package com.ts.controller.achievement;

import com.ts.dto.AchievementPageDTO;
import com.ts.result.PageResult;
import com.ts.result.Result;
import com.ts.service.achievement.AchievementService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 成果相关接口 - 成果总表相关成果的查询
 */
@RestController
@RequestMapping("/achievement/achievement-total")
@Tag(name = "成果相关接口", description = "成果的查询功能")
@Slf4j
public class AchievementController {

    @Autowired
    private AchievementService achievementService;

    @GetMapping("/page")
    @Operation(summary = "分页查询", description = "成果总表的分页查询")
    public Result<PageResult> page(AchievementPageDTO achievementPageDTO) {
        log.info("成果总表的分页查询：{}", achievementPageDTO);
        PageResult pageResult = achievementService.pageQuery(achievementPageDTO);
        return Result.success(pageResult);
    }

}
